<!DOCTYPE html>
<html lang="en">
<head>
	<title>La Casa - Real Estate HTML5 Home Page Template</title>
	<meta charset="utf-8">
	<meta name="author" content="pixelhint.com">
	<meta name="description" content="La casa free real state fully responsive html5/css3 home page website template"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
	
	<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="js/checkVerifyCode.js" ></script>
	<link rel="stylesheet" type="text/css" href="css/signupin.css">
	<script type="text/javascript">
	$(document).ready(function() {
		createCode();
	});
	
	function login() {
		alert("hahahahhahahahahahahahahahahhaha");
		$("#login_submit").css("background","rgb(99,209,169)");
		if($("#password").val().length()<8) {
			$("#error_tip").html("密码长度为8-20字符");
			$("#error_tip").css("display","block");
		}
		$.ajax({
        	data:"username_password="+$("#username").val()+"|"+$("#password").val(),
        	type:"POST",
        	dataType:'json',
        	url:"user/login.do",
        	error:function(data) {
        		alert("返回数据失败！");
        	},
        	success: function(data) {
        		if($.trim(data.msg)==$.trim("账号或密码错误")) {
        			$("#error_tip").html(data.msg);
        			$("#error_tip").css("display","block");
        		} else {
        			window.location.href = "index.html"; 
        		}
           	 		 
        	}
    	});
	}
	
	</script>
	
</head>
<body>
	<section class="signupin">
		
		<div class="signupNav">
			<div id="label"><a href="index.html" >&#60; Back to HomePage</a></div>
		</div>
		<div class="signup">
			<!-- <div id="vaildate" style="width:300px; height:150px; background:red">asasas</div> -->
			<div id="logo">
				<img class="logo" src="img/1.0logo_vqfr2u.png"></img>
			</div>
			<p style="text-align:center;"><a style="font-size:12px">Find you new hone on YouFound</a></p>
			<div class="form_wrapper">
				<form id="signinForm" method="post" action="user/login.do" class="zcform">
					<!-- <p>
						<a id="error_tip"></a>
					</p> -->
					<p>
						<a id="error_tip"  style="font-size:14px; color:red; float:left; 
						margin-bottom:10px; margin-left:22%;display: none;" ></a>
					</p>
					<p class="clearfix">
						<input id="username" name="username" class="required" value
							placeholder="Username / Email / Phone" style="border-radius:5px;"
							onblur="validateLogin()"/>
					</p>
					<p class="clearfix">
						<input type="text" id="J_codetext" class="checkCode" placeholder="Type Here"
							maxlength="5" style="border-top-left-radius:5px; border-bottom-left-radius:5px" 
							onblur="validateCheckCodeAndLogin">
						<canvas id="myCanvas" class="randomCode" onclick="createCode()"
						style="border-top-right-radius:5px; border-bottom-right-radius:5px">
							Your browser does not support the canvas element.
						</canvas>
					</p>
					<p class="clearfix">
						<input id="password" name="password" type="password"
							class="{required:true,rangelength:[8,20],}" value
							placeholder="Your Password" style="border-radius:5px;"/>
					</p>
					
					<p class="clearfix">
						<input id="login_submit" class="submit" type="button" value="Login" style="border-radius:5px;"
						 onclick="login()"/><!-- disabled="disabled" -->
					</p>
					
				</form>
			</div>



		</div>
		<!-- <section class="caption">
			<h2 class="caption">Find You Dream Home</h2>
			<h3 class="properties">Already a user?</h3>
			<h3 >Already a user?<a href="register.jsp" style="font-size:3em ">Login</a></h3>
			
		</section> -->
		
	</section>
	<!--  end hero section  -->
</body>
</html>